<template>
    <el-card :style="CCFormStyle">
        <div v-html="HtmlTemplateFile" id="CCForm" ></div>
    </el-card>

</template>

<script>
    import {sendThis} from '@/api/MapExt.js';
    import "@/assets/style/ccbpm.css";

    import {ParseDevelopFrm} from '@/api/FrmDevelop.js';
    export default {
         name: "FrmDevelop",
         props:{
            PFrmData:{type:Object,default:null},
            mainData:{},
            isReadOnly:{type:Number ,default:0},
            isReadOnlyExt:{type:Number,default:0}
         },
         data(){
             return{
                 params:{},
                 frmData:{},
                 mianData:{},
                 sysGroupFields:[],//分组
                 mapAttrs:{},//表单字段
                 rules:{},//表单字段校验规则 必填，正则表达式
                 aths:[], //附件
                 dtls:[], //从表
                 FK_MapData:"",
                 workID:0,
                 node:{},
                 HtmlTemplateFile:"",
                 CCFormStyle:{margin:"20px auto"},
             }
         },
         created(){
             // 发送this 到 js 文件里
             sendThis(this);
             this.frmData = this.PFrmData;
              this.params = this.$store.getters.getData;
              this.workID = this.params.WorkID;
              this.FK_MapData = this.frmData["Sys_MapData"][0].No;
              this.node = this.frmData["WF_Node"][0];
              this.CCFormStyle={"width":this.frmData.Sys_MapData[0].FrmW+"px",margin:"20px auto"};
              this.InitHtml();


         },
         methods:{
            InitHtml(){
                var handler=new this.HttpHandler("BP.WF.HttpHandler.WF_Admin_DevelopDesigner");
                handler.AddPara("FK_MapData", this.FK_MapData);
                this.HtmlTemplateFile = handler.DoMethodReturnString("Designer_Init");
                if ( this.HtmlTemplateFile == "") {
                    this.HtmlTemplateFile="开发者设计的表单内容丢失，请联系管理员";
                    return;
               }
               this.HtmlTemplateFile =  this.HtmlTemplateFile.replace(new RegExp("../../../", 'gm'), "../");
            },

         },
         mounted:function(){

               //处理html标签内容
               ParseDevelopFrm(this.params,this.frmData);
         }
    }
</script>

<style scoped>

</style>